﻿namespace MSSqlSchemaDoc.Core.DataStructures
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    /// <summary>
    /// All objects that represent data structures should implement this interface.
    /// Data Structure Objects are pure "data" objects and shouldn't contain any methods. This is
    /// to maximize their cross-database support.
    /// </summary>
    public interface IDataStructureObject
    {
        /// <summary>
        /// Gets the type of object that is being represented.
        /// Common object types are represented by the enumeration <see cref="DataStructureObjectType">DataStructureObjectType</see>,
        /// but values are not limited to those in the enumeration.
        /// </summary>
        DataStructureObjectType ObjectType { get; }

        /// <summary>
        /// Gets or sets the id of the object as assigned by the database server.
        /// </summary>
        int ObjectId { get; set; }

        /// <summary>
        /// Gets or sets the name of the object, excluding it's schema.
        /// </summary>
        string Name { get; set; }

        /// <summary>
        /// Gets or sets the documentation object.
        /// </summary>
        IDocumentationObject Documentation { get; set; }

        /// <summary>
        /// Returns a string containing the name of the object.
        /// </summary>
        /// <returns>
        /// The full name of the object in a form similar to "ObjectName_SchemaName" if the object belongs to a schema,
        /// otherwise just returns the name of the object.
        /// </returns>
        string ToString();
    }
}
